package com.learn.service.impl;

import com.learn.annotation.Secure;
import com.learn.model.User;
import com.learn.service.IHelloService;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class HelloServiceImpl implements IHelloService {

    private void say(String msg) {
        System.out.println(msg);
    }

    @Override
    public void sayHello() {
        this.say("hello aop");
    }

    @Override
    public void sayHello(String msg) {
        this.say("hello " + msg);
    }

    @Override
    @Deprecated
    public void deprecatedF() {
        this.say("该方法已被废弃");
    }

    @Override
    @Secure
    public void secureF() {
        this.say("该方法有注解@Secure");
    }

    @Override
    public User secureF2() {
        this.say("该方法返回值有注解@Secure");
        return null;
    }

    @Override
    public void testDate(Date date) {
        this.say("该方法参数Date");
    }

    @Override
    public void testNull() {
        this.say("该方法无参数");
    }
}
